﻿/*
 * Created by SharpDevelop.
 * User: Михаил
 * Date: 11.01.2014
 * Time: 15:31
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Threading;
using Region.Utils;
namespace Region.Test
{
	/// <summary>
	/// Description of TestWorkManager.
	/// </summary>
	public class TestTaskManager
	{
		static void Task1(Object Param,TaskManager.Task task)
		{
			Int32 i=0;
			while(true)
			{
				task.TaskValue = i;
				task.TaskMax = 3000;
				i++;
				if (task.TaskValue>task.TaskMax) break;
				Thread.Sleep(1);
			}
		}
		static public Boolean Test(Engine engine)
		{
			engine.taskManager.addTask(Task1,"Тестовая задача",null);
			var f = new Forms.TaskWait(engine);
			f.ShowDialog();
			return true;
		}
	}
}
